
import sheep from '@/sheep'
import {
  defineStore
} from 'pinia'
import $router from '@/sheep/router'
import $platform from '@/sheep/platform'
const app = defineStore({
  id: 'app',
  state: () => ({
  }),
  actions: {
    // 获取sheep应用配置和模板
    async init() {
      // 检查网络
      const networkStatus = await $platform.checkNetwork()
      if (!networkStatus) {
        $router.error('NetworkError')
      }
    }
  },
  persist: {
    enabled: true,
    strategies: [{
      key: 'app-store'
    }]
  }
})
export default app
